package api03a;

import java.util.*;

public class MapDemo3 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        map.put("语文",99);
        map.put("数学",98);
        map.put("英语",88);
        map.put("物理",80);
        map.put("化学",99);
        System.out.println();

        Set<String> keySet = map.keySet();
        for (String str : keySet){
            System.out.println(str);
        }

        Collection<Integer> values = map.values();
        for(Integer value : values){
            System.out.println(value);
        }

        Set<Map.Entry<String,Integer>> entrySet = map.entrySet();
        for (Map.Entry<String,Integer> e :entrySet){
            String key = e.getKey();
            Integer value = e.getValue();
            System.out.println("key:"+key+", value:"+value);
        }






    }
}
